package com.castillo.exam;

import java.util.Random;

import com.opensymphony.xwork2.ActionSupport;

public class New extends ActionSupport {
	private String message;
	private String name;
	private String address;

	
	@Override
	public String execute() throws Exception {
		System.out.println("New action> Execute");
			message = "New Provider Added";
			ProviderDAO aDAO= new ProviderDAO();
			aDAO.insert(new Provider( name,address ));
			return SUCCESS;
		
	}
	@Override
	public String input() throws Exception {
		System.out.println("New action> Input");
		return super.input();
		
	}
	
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getAddress() {
		return address;
	}
	public void setAddress(String address) {
		this.address = address;
	}
	
}


